<template>
  <KView class="home-circle-theme">
    <KView class="home-circle-theme-content clearfix">
      <KView v-for="theme in themes" :key="theme.id" class="home-circle-theme-item" :style="{color:theme.color}" @click="themeClick(theme)">
        <KView>#</KView>
        <KView class="ellipsis" style="max-width:5em">{{theme.text}}</KView>
        <KView>#</KView>
      </KView>
    </KView>
    <KView class="home-circle-theme-more">
      <span @click="themeClick()">查看所有主题 ></span>
    </KView>
  </KView>
</template>

<script>
  export default {
    props: {
      themes: {
        type: Array,
        required: true
      }
    },

    data() {
      return {};
    },

    methods: {
      themeClick(theme = null) {
        this.$emit('theme-click', theme);
      }
    }
  };

</script>

<style lang="scss">
  .home-circle-theme {
    .home-circle-theme-content {
      margin-right: formatPx(-26);

      .home-circle-theme-item {
        float: left;
        height: formatPx(40);
        line-height: formatPx(40);
        margin-right: formatPx(26);
        margin-bottom: formatPx(10);

        >div {
          float: left;
          height: 100%;
        }
      }
    }

    .home-circle-theme-more {
      text-align: right;
      margin-top: formatPx(4);
    }
  }

</style>
